package com.freedom.ums.member.interfaces.facade;

import com.freedom.common.core.result.CommonResult;
import com.freedom.ums.member.application.service.query.MemberQueryService;
import com.freedom.ums.api.member.feign.MemberFeign;
import com.freedom.ums.api.member.pojo.dto.MemberAuthDTO;
import com.freedom.ums.api.member.pojo.dto.MemberDTO;
import com.freedom.ums.api.member.pojo.dto.MemberLoginDTO;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "「Feign调用」会员")
@RestController
@RequestMapping("/feign/member")
@RequiredArgsConstructor
public class MemberFeignController implements MemberFeign {

    private final MemberQueryService memberQueryService;

    @GetMapping("/mobile/{mobile}")
    @Override
    public CommonResult<MemberAuthDTO> findMemberByMobile(@PathVariable String mobile) {
        return CommonResult.success(memberQueryService.findMemberByMobile(mobile));
    }

    @Override
    public CommonResult<MemberAuthDTO> findMemberByEmail(String email) {
        return null;
    }
    @Override
    public CommonResult<Integer> addMember(MemberDTO member) {
        return null;
    }

    @Override
    public CommonResult<String> getMemberOpenId(Integer memberId) {
        return null;
    }

    @Override
    public CommonResult<MemberAuthDTO> loadUserByOpenId(String openid) {
        return null;
    }

    @Override
    public CommonResult<Boolean> memberLoginRecord(MemberLoginDTO memberLoginDTO) {
        return null;
    }

}
